﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace iPublic.SysTools
{
    public partial class FrmHint : Form
    {
        public FrmHint()
        {
            InitializeComponent();
        }

        private void FrmHint_Load(object sender, EventArgs e)
        {
            try
            {
                FormBorderStyle = FormBorderStyle.None;
                btn_ok.Focus();
            }
            catch (Exception x)
            { }
        }

        private void FrmHint_Shown(object sender, EventArgs e)
        {
            tm_main.Tag = Convert.ToInt16(lbl_time.Text);
            tm_main.Enabled = true;
        }

        private void btn_ok_Click(object sender, EventArgs e)
        {
            Close();
            DialogResult = DialogResult.OK;
        }

        private void tm_main_Tick(object sender, EventArgs e)
        {
            Timer tm = sender as Timer;
            bool lEnable = tm.Enabled;
            tm.Enabled = false;
            //
            int n = Convert.ToInt16(lbl_time.Text) - 1;
            lbl_time.Text = n.ToString();
            if (n <= 0) btn_ok_Click(sender, e); else tm.Enabled = lEnable;
        }
    }
}
